Tweak the new project template to be more idiomatic.
authorNick Cameron <ncameron@mozilla.com>
Thu, 31 Dec 2015 03:12:56 +0000 (16:12 +1300)
committerNick Cameron <ncameron@mozilla.com>
Thu, 31 Dec 2015 03:12:56 +0000 (16:12 +1300)
src/cargo/ops/cargo_new.rs

index 4487f3166b47ede817f691adc071af3af2aed180..cf54e87d90733ef6b3d9f9fe2248573f4ad180ce 100644 (file)
@@ -159,8 +159,11 @@ fn main() {
 "));
     } else {
         try!(paths::write(&path.join("src/lib.rs"), b"\
-#[test]
-fn it_works() {
+#[cfg(test)]
+mod test {
+    #[test]
+    fn it_works() {
+    }
 }
 "));
     }